package com.hpe.wx.performance.redis.service;

import java.io.IOException;
import java.util.List;
import java.util.Set;

import javax.management.AttributeNotFoundException;
import javax.management.InstanceNotFoundException;
import javax.management.MBeanException;
import javax.management.MalformedObjectNameException;
import javax.management.ReflectionException;

import redis.clients.jedis.Tuple;

public interface PerFormanceService {
	public Long zAddData(String key, double score,String member); 
	
	public List<String> getDataListByIndex(String key, long indexStart, long indexEnd, int orderBy);
	
	public List<String> getTimeStamp(String jmxUrl, String key, int orderBy);
	
	public List<Object> getDataListByScore(String key, double scoreStart, double scoreEnd, int orderBy);
	
	public List<Double> getTimeDataListByScore(String key, double scoreStart, double scoreEnd, int orderBy);
	/**get the jmxUrls that stored in the redis 
	 * @return
	 */
	public Set<Tuple> getAllJMXURLs();
	
	/**add the data into redis database 
	 * @param jmxUrl
	 */
	public void addDate2Redis(String jmxUrl)  throws MalformedObjectNameException, AttributeNotFoundException, InstanceNotFoundException, MBeanException, ReflectionException, IOException;
	
	public void addJMXURL(String jmxUrl );
	
	public void removeJMXURL(String jmxUrl);
	
	public Long removeKey(String key);
	
	
	// function for redis list 
	public Long lAddData(String key, String value); 
	
	public List<String> lGetDataListByIndex(String key, int indexStart, int indexEnd, int orderBy);
	
	public List<String> lGetTimeStamp(String jmxUrl, String key, int orderBy);
	
	public List<String> lGetDataListByScore(String key, int indexStart, int indexEnd, int orderBy);
	
	/**get the jmxUrls that stored in the redis 
	 * @return
	 */
	public Set<Tuple> lGetAllJMXURLs();
	
	/**add the data into redis database 
	 * @param jmxUrl
	 */
	public void lAddDate2Redis(String jmxUrl);
	
	public void lAddJMXURL(String jmxUrl);
	
	public void lRemoveJMXURL(String jmxUrl);
	
	public Long lRemoveKey(String key);
	
}
